install_pptpd:
  pkg.installed:
    - name: pptpd

pptpd_running:
  service.running:
    - name: pptpd
    - enable: True
    - require:
      - pkg: install_pptpd
    - watch:
      - file: options.pptpd
      - file: chap-secrets
      - file: pptpd.conf
      - file: ip-up
pptpd.conf:
  file.managed:
    - name: /etc/pptpd.conf
    - source: salt://pptp/pptpd.conf
    - require:
      - pkg: install_pptpd

options.pptpd:
  file.managed:
    - name: /etc/ppp/options.pptpd
    - source: salt://pptp/options.pptpd

chap-secrets:
  file.managed:
    - name: /etc/ppp/chap-secrets
    - source: salt://pptp/chap-secrets

ip-up:
  file.managed:
    - name: /etc/ppp/ip-up
    - source: salt://pptp/ip-up
    
net.ipv4.ip_forward:
  sysctl.present:
    - value: 1
